<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" href="css/nav.css">
		<link rel="stylesheet" href="bootstrap-3.3.5/css/bootstrap.css">
		<title>添加教师信息</title>
		<link href="css/index.css" rel="stylesheet" type="text/css" /> 
		<link rel="stylesheet" type="text/css" href="css/add_admin.css"/> 
		<script type="text/javascript" src="js/jquery.1.4.2-min.js"></script>
		<script type="text/javascript" src="js/Calculation.js"></script>	
	<!--	<script language="JavaScript" src="js/add_admin.js"></script>-->
	</head>
	
	<body>
		<div class="ads">
		<form>
			输入教师号:<input type="text" id="tid" value="" /><hr>
			输入密码:<input type="text" id="tpassword" value=""/><hr>
			输入姓名:<input type="text" id="tname" value=""/><hr>
			输入学院:<input type="text" id="tcollege" value=""/><hr><br>
			输入手机号:<input type="text" id="phone" value=""/><hr>
			输入职位:<input type="text" id="position" value=""/><hr><br>
			<p><input value="提交" type="button" id="send"/></p>
	    </form>	
	   </div>
	   	<script type="text/javascript">
	   	  $('#send').click(function(){//.
		   //alert(1);//...
            $.ajax({  
                type: 'POST',  
                url: '/teachers',
                data: {
                    tid: $('form input[type=text]').val(),  
                    tpassword: $('form input[type=password]').val(),  
                    tname: $('form input[type=text]').val(),  
                    tcollege: $('form input[type=text]').val(),  
                    phone: $('form input[type=text]').val(),
                    position: $('form input[type=text]').val() 
			},
				//contentType:"application/json",//....
					error : function() {
			   alert('请求失败 ');
		   },
                 success:function(res) {
					 console.log(res);
                alert('添加成功 ');
                 },
             });
         });
	</script>
	   
	</body>
</html>
